using System;
using System.IO;

namespace Atomic.Vasp.Options
{
	/// <summary>
	/// Calculate elastic constants (IBRION=6 and ISIF>=3).
	/// http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_5_IBRION_6.html
	/// </summary>
	[Serializable]
	public class ElasticTensor : VaspOption
	{
		public ElasticTensor()
		{
		}

		public override void Write(VaspIncar incar, DirectoryInfo directory)
		{
			// Use finite difference scheme to compute strains.
			incar.Add("IBRION", "6", "Calculate elastic constants");

			// Allow full relaxation of ions in response to the stress. Only the finite-difference
			// scheme (IBRION=5,6) supports this; not supported by the DPFT (IBRION=7,8).
			incar.Add("ISIF", "3");

			// Before you perform relaxations in which the volume or the cell shape is allowed to
			// change you must read and understand section 9.6. In general volume changes should be
			// done only with a slightly increased energy cutoff (i.e. ENCUT=1.3 * default value,
			// or PREC=High in vasp.4.4).
			// http://cms.mpi.univie.ac.at/vasp/guide/node112.html
			// http://cms.mpi.univie.ac.at/vasp/guide/node161.html#pullay
		}
	}
}
